﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<#include "/pages/include/include.ftl" />
<@h.css href="/css/uc.css"/>
<@h.js src="/javascripts/public/news.js"/>
<@h.js src="/javascripts/public/area.js"/>
<#include "/pages/include/setlayout.ftl" />
<script type="text/javascript">
	var news=new news();
	var area=new area();
		$(function(){
			//all select
			$('.allSelect').click(function(){
				news.checkAll($(this));
			});
			//delete
			$('#delBatch').click(function(){
				news.delBatch();
			});
			$("#txtCate").ligerComboBox({
	            width: 130,
	            selectBoxWidth: 200,
	            selectBoxHeight: 200,treeLeafOnly:false,
	            tree: { data: ${data},checkbox:false,onBeforeCollapse:function(node){return true;}},
	            valueFieldID: 'params.category',
	            initValue:'${params.category?if_exists}',
	            initText:'${cateText?if_exists}'
	        });
		});
function keydown(e){
	 var code = window.event ? e.keyCode:e.which;
	if (code==13) {
		news.search();
	}
}
</script>
</head>

<body onkeydown="javascript:keydown(event)">
<#assign menuId="news">
<div id="layout1" class="wrapper">

	<#include "/pages/include/top.ftl" />
	
	<#include "/pages/person/myfile/file_menu.ftl" />
	
	<div position="center" title="资讯管理">
		<div class="action-div" style="float:left;">
		<#if action.hasAuth("NEWS_DEL")>
			<a id="delBatch" class="minibutton"><span>删除</span></a>
		</#if>
		<#if action.hasAuth("NEWS_PUB")>
			<a id="addNews" href="${contextPath}/news/news-goPublish.action" class="minibutton" style="width:90px;"><span>发布新的资讯</span></a>
		</#if>
			移至<input class="inputText" type="text" id="toPosition" name="" value="" style="width:30px;margin:0 2px;"/>前
			<a class="minibutton" href="javascript:news.goPosition($('#toPosition').val());"><span>确定</span></a>
		</div>
		<form id="searchForm" action="news-home.action" method="get">
		<div class="action-div" style="float:left;margin-left:30px;">
						板块： <@s.select name="params.areaName" headerKey="-1" headerValue="请选择" list="areas" listKey="id" listValue="name"/>
		</div>
		<div class="action-div" style="float:left;">
						<table style="float:left;" cellpadding="0" cellspacing="0" border="0" >
							<tr>
								<td style="width:40px">标题：</td>
								<td style="width:140px"><input type="text" class="inputText" value="${params.title?if_exists}" name="params.title" /></td>
								<td style="width:40px">分类：</td>
								<td style="width:140px"><input type="text" value="${cateText?if_exists}" id="txtCate"/></td>
								<td style="width:30px"><a class="minibutton" href="javascript:news.search();"><span>查询</span></a></td>
							</tr>
						</table>
		</div>
		</form>
		<div  class="sList" >
		<table width="100%" class="sTable" cellpadding="0" cellspacing="0" border="0" >
			<tr>
				<td class="sTh checkbox" ><input class="inputCheckbox allSelect" type="checkbox" id="" name="" /></td>
				<th class="sTh">ID</th>
				<th class="sTh">标题</th>
				<th class="sTh">分类</th>
				<th class="sTh">浏览量</th>
				<th class="sTh">发表人</th>
				<th class="sTh">发表时间</th>
				<th class="sTh">操作</th>
				<th class="sTh">排序</th>
			</tr>
		<#if newsList?exists>
		<#list newsList.result as a>
			<tr class="<#if a_index%2==0>sRow2<#else>sRow1</#if>">
				<td class="sCell" ><input class="inputCheckbox selectItem" type="checkbox" value="${a.id?if_exists}" /></td>
				<td class="sCell">${a.id?if_exists}</td>
				<td class="sCell">
				<a class="f14" href="${contextPath}/news/news-showNews.action?newsId=${a.id?if_exists}" title="${a.title?if_exists} ">
				${a.title?if_exists} </a></td>
				<td class="sCell">${a.category?if_exists}</td>
				<td class="sCell">${a.browserNum?if_exists}</td>
				<td class="sCell">${a.publishUserName?if_exists}</td>
				<td class="sCell">${a.publishTime?if_exists?string('yyyy-MM-dd HH:mm:ss')}</td>
				<td class="sCell">
				<a class="op" href="${contextPath}/news/news-gotoEdit.action?newsId=${a.id?if_exists}">编辑</a>
				</td>
				<td class="sCell">
					<#assign lid=action.lid(a.position)>
					<#if lid!=-333>
						<a class="sliverbutton"  onclick="area.top1('${a.id}');"><span>置顶</span></a>
					</#if>
				</td>
			</tr>
		</#list>
		</#if>
		</table>
		</div>
		<@s.component id="page" template="components/page.ftl"> 
				<@s.param name="page" value="%{newsList}" />
				<@s.param name="pageRange" value="%{pageRange}" />
				<@s.param name="param" value="%{action.param}" />
		</@s.component>
	</div>
	<input type="hidden" name="params.category" value="" id="params.category" />
	<#include "/pages/include/bottom.ftl" />
	
</div>

</body>

</html>
